import React from 'react';
import { inject, observer } from 'mobx-react';

@inject('portalLoginStore')
@observer
class LoginBtn extends React.Component {
    constructor(props) {
        super(props);
        this.onLogin = this.onLogin.bind(this);
    }


    render() {
        const { portalLoginStore, getState } = this.props;
        let { state } = portalLoginStore;
        state = getState();
        const { loginSettingInfo } = state;
        let { loginForm } = loginSettingInfo;
        const { e7LoginButtonColor } = loginForm;

        return (
            <div className="loginBtn" style={{ color: e7LoginButtonColor }} onClick={this.onLogin} />
        );
    }
    onLogin() {
        const { portalLoginStore, isSetting } = this.props;
        if (!isSetting) {
            portalLoginStore.onLogin();
        }
    }
}

export default LoginBtn;
